package com.qk.management.controller;

import com.qk.common.Result;
import com.qk.dto.role.RoleDTO;
import com.qk.entity.PageResult;
import com.qk.entity.Role;
import com.qk.management.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping(path = "/roles")
@SuppressWarnings("all")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @GetMapping
    public Result page(RoleDTO dto){
        PageResult<Role> result = roleService.page(dto);
        return Result.success(result);
    }

    @GetMapping("/list")
    public Result list(){
        return Result.success(roleService.list());
    }


}